# $Id$
# Maintainer: Felix Huettner <huettner94@gmx.de>

pkgname=mutt
pkgver=1.13.3
pkgrel=1
pkgdesc='Small but very powerful text-based mail client (net-utils)'
url='http://www.mutt.org/'
license=('GPL')
groups=('net-utils')
backup=('etc/Muttrc')
arch=('i686' 'x86_64')
depends=('libgpgme' 'libsasl' 'libgdbm' 'ncurses' 'libgnutls' 'libidn2')
makedepends=('libgpgme-devel' 'libsasl-devel' 'libgdbm-devel' 'ncurses-devel' 'libgnutls-devel' 'libidn2-devel')
source=("http://ftp.mutt.org/pub/mutt/${pkgname}-${pkgver}.tar.gz"{,.asc})
sha256sums=('78423016b5f2fcb31bfd156999ff6638177be4459230d2ee61a81e5641d07378'
            'SKIP')
validpgpkeys=('8975A9B33AA37910385C5308ADEF768480316BDA')

build() {
  cd "${srcdir}/${pkgname}-${pkgver}"
  ./configure \
    --prefix=/usr \
    --sysconfdir=/etc \
    --enable-gpgme \
    --enable-pop \
    --enable-imap \
    --enable-smtp \
    --enable-hcache \
    --with-curses=/usr \
    --with-regex \
    --with-gss=/usr \
    --with-gnutls=/usr \
    --with-sasl \
    --with-idn2 \
    --with-gdbm \
    --with-mailpath=/var/spool/mail

  make
}

check() {
  cd "${srcdir}/${pkgname}-${pkgver}"
  make -k check
}

package() {
  cd "${srcdir}/${pkgname}-${pkgver}"
  make DESTDIR="${pkgdir}" install

  rm "${pkgdir}"/etc/mime.types{,.dist}
  install -Dm644 contrib/gpg.rc "${pkgdir}"/etc/Muttrc.gpg.dist
}
